<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/views/commons/taglibs.jsp" %>
<div class="panel-heading">
	<div class="pull-right">
		<a href="<%=path %>/admin/news/toInsert">发布新闻</a>
	</div>
	<h3 class="panel-title">新闻列表</h3>
</div>
<div class="bd clearfix">
	<form id="admin_news_choose_form" action="javascript:queryAdminNewsList(1);">
		<div class="filter-wrap">
			<dl class="clearfix invest-filter">
				<dt>新闻标题</dt>
				<dd class="clearfix">
					<ul class="col-sm-5"><input type="text" class="form-control" name="newsTitle" value="${paramMap.newsTitle}" placeholder="请输新闻标题关键词"></ul>
				</dd>
			</dl>
		</div>
		<div class="text-center pb20">
			<button class="btn btn-primary">搜索</button>
		</div>
	</form>
</div>
<c:choose>
<c:when test="${!empty dataList && fn:length(dataList) ne 0}">
<table class="table">
	<thead>
		<tr>
			<th width="70%">标题</th>
			<th width="10%">类型</th>
			<th width="20%">发布时间</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="news" items="${dataList}" varStatus="index">
		<tr>
			<td class="title">
				<a href="<%=path %>/admin/news/toUpdate/${news.newsId}">${news.newsTitle}</a>
			</td>
			<td>
				<c:choose>
					<c:when test="${news.newsType==1}">新闻</c:when>
					<c:when test="${news.newsType==2}">分析观点</c:when>
				</c:choose>
			</td>
			<td><fmt:formatDate value="${news.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<!-- 分页 -->
<p:pagination pageNo="${paramMap.pageNo}" pageCount="${paramMap.pageCount}" queryFunction="queryAdminNewsList" style="text-center"></p:pagination>
<!-- 分页 end -->
</c:when>
<c:otherwise>
	<table class="table">
		<thead>
			<tr>
				<th>标题</th>
				<th>类型</th>
				<th>发布时间</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td colspan="3" align="center">
					暂无数据
				</td>
			</tr>
		</tbody>
	</table>
</c:otherwise>
</c:choose>